// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   tableb_save.java

package finance.reports;

import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class tableb_save extends HttpServlet
{

	public tableb_save()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		javax.servlet.ServletContext dbApplication = dbSession.getServletContext();
		HttpSession session = request.getSession();
		nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication);
		try
		{
			if (finance_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String report_unit = request.getParameter("report_unit");
				String account_period = request.getParameter("account_period");
				String item_year30 = request.getParameter("profit");
				String sql1 = (new StringBuilder("delete from finance_report_02 where account_period='")).append(account_period).append("'").toString();
				finance_db.executeUpdate(sql1);
				String sql = (new StringBuilder("insert into finance_report_02(report_unit,account_period,item_year30) values('")).append(report_unit).append("','").append(account_period).append("','").append(item_year30).append("')").toString();
				finance_db.executeUpdate(sql);
				finance_db.commit();
				finance_db.close();
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
